#include <iostream>

const int ArSize = 80;

int main(){
    using namespace std;

    char line[ArSize];
    int spaces = 0;

    cout << "Enter a line of text: " << endl;
    cin.get(line, ArSize);
    cout << "Complete line:" << endl << line << endl;

    for (auto ch: line){
        cout << ch;
        if (ch == '.')
            break;
        if (ch != ' ')
            continue;
        spaces++;
    }
    cout << endl << spaces << " spaces.\n";
    cout << "Done.\n";

    return 0;
}